home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / idt.zip / WHAT.H < prev    next >
Text File  |  1988-06-11  |  2KB  |  106 lines

  1. /*
  2. **    file:        what.h
  3. **
  4. **    purpose:    This file contains macro definitions used
  5. **            to incorporate "what" strings into a
  6. **            program.  A what string is defined as any
  7. **            sequence of printable characters following
  8. **            the occurrance of the pattern '@(#)' up to
  9. **            the first ", >, \n, \, or \0 character. All
  10. **            "what" strings created by these macros are
  11. **            null '\0' terminated.
  12. **
  13. **            Typically, "what" strings may contain version,
  14. **            usage, copyright, or other miscellaneous
  15. **            information.
  16. **
  17. **            They may be displayed using the utility "what".
  18. **
  19. **            This utility comes direct to you without commercial
  20. **            interruption from Unix (tm) and Unix-derived
  21. **            operating systems.  (Unix is a registered
  22. **            trademark of AT&T.
  23. **
  24. **
  25. **    usage:        WHATVER(p,v,r)
  26. **
  27. **            This macro expands to a "what" string containing
  28. **            the program's name, version and revision.
  29. **
  30. **                p = The program name (quoted)
  31. **                v = version  (may be #defined)
  32. **                r = revision  (may be #defined)
  33. **
  34. **            Example:
  35. **
  36. **                #define VER 1
  37. **                #define REV 0
  38. **                WHATVER("DEMO", VER, REV)
  39. **
  40. **                expands to:
  41. **
  42. **                @(#)DEMO, Version 1.0\0
  43. **
  44. **
  45. **    usage:        WHATWHEN
  46. **
  47. **            This macro expands to a "what" string containing
  48. **            the date and time of the file's compilation.
  49. **
  50. **            Example:
  51. **
  52. **                WHATWHEN
  53. **
  54. **                expands to:
  55. **
  56. **                @(#)fubar.c: Compiled on Jun 10 1988 at 22:17:20\0
  57. **
  58. **
  59. **    usage:        WHATDATE
  60. **
  61. **            This macro expands to a "what" string containing
  62. **            the day, date, and time of the contained source
  63. **            file's last modification.
  64. **
  65. **            Example:
  66. **
  67. **                WHATDATE
  68. **
  69. **                expands to:
  70. **
  71. **                @(#)fubar.c: Last modified on Fri Jun 10 22:17:00 1988\0
  72. **
  73. **
  74. **    usage:        WHAT(s)
  75. **
  76. **            This macro expands to a "what" string containing
  77. **            the caller supplied string s.
  78. **
  79. **                s = quoted string
  80. **
  81. **            Example:
  82. **
  83. **                WHAT("if u cn rd ths u cn gt a gd jb!")
  84. **
  85. **                expands to:
  86. **
  87. **                @(#)if u cn rd ths u cn gt a gd jb!\0
  88. */
  89.  
  90. /*    magic bullet    */
  91.  
  92. #define    WHATKEY    "@(#)"
  93.  
  94. /*
  95. **    _N(n) is needed so we can include #define'd numbers
  96. **    as arguments to WHATVER.
  97. */
  98.  
  99. #define    _N(n)    #n
  100.  
  101. #define    WHATVER(p,v,r)    WHATKEY p ", Version " _N(v) "." _N(r)
  102. #define    WHATWHEN    WHATKEY __FILE__ ": Compiled on " __DATE__ " at " __TIME__
  103. #define    WHATDATE    WHATKEY __FILE__ ": Last modified on " __TIMESTAMP__
  104. #define    WHAT(s)        WHATKEY s
  105.  
  106.